Learning FuelPHP for Effective PHP Development by 2013

Learning FuelPHP for Effective PHP Development by 2013

Author:2013
Language: eng
Format: epub, mobi
Publisher: Packt Publishing


With these additions, we are configuring the ORM model to treat the relationship between entries and categories as a many-to-many relationship. Instead of directly linking categories to entries, we are using the category_entry link table. This table is named using the singular version of the tables to be linked in an alphabetical order; in this case, the joining of categories and entries gives us a table name category_entry. The reason we want to use the link table is because we want to have the ability to assign multiple categories to each entry, so that the categories can be reused without requiring duplication. For example, if we retrieve an entry, the list of categories would be obtained in the following manner:

$entry = Model_Entry::find(1) $categories =$entry->categories;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.